package handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;

public class FameItem implements IItemHandler
{
	/* (non-Javadoc)
	 * @see com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable, com.l2jserver.gameserver.model.L2ItemInstance, boolean)
	 */
	@Override
	public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
	{
		if (!(playable instanceof L2PcInstance))
		{
			playable.sendMessage("You cant use this item!");
			return;
		}
		L2PcInstance activeChar = (L2PcInstance)playable;
        activeChar.setFame((activeChar.getFame() + 10000));
		activeChar.sendMessage("Your fame increased by "+ 10000 +" fame points!");
        MagicSkillUse MSU = new MagicSkillUse(activeChar, activeChar, 2024, 1, 1, 0);
		activeChar.broadcastPacket(MSU);
        activeChar.broadcastUserInfo();
        playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
	}	
}
